package com.ruoyi.resp;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;
@Data
public class DeviceLocationStats {
    private String deviceType; // 设备类型
    private List<String> locations; // 位置列表

    // 构造方法
    public DeviceLocationStats() {}

    public DeviceLocationStats(String deviceType) {
        this.deviceType = deviceType;
        this.locations = new ArrayList<>();
    }

    // Getter 和 Setter
    public String getDeviceType() {
        return deviceType;
    }

    public void setDeviceType(String deviceType) {
        this.deviceType = deviceType;
    }

    public List<String> getLocations() {
        return locations;
    }

    public void setLocations(List<String> locations) {
        this.locations = locations;
    }

    // 添加位置
    public void addLocation(String location) {
        if (!locations.contains(location)) {
            locations.add(location);
        }
    }
}